var worldMapContainer = document.getElementById('main');
//用于使chart自适应高度和宽度,通过窗体高宽计算容器高宽
var resizeWorldMapContainer = function () {
    worldMapContainer.style.width = window.innerWidth+'px';
    worldMapContainer.style.height = window.innerHeight+'px';
};
//设置容器高宽
resizeWorldMapContainer();
var myChart = echarts.init(worldMapContainer);
myChart.setOption({
    tooltip: {
        axisPointer: {            // 坐标轴指示器，坐标轴触发有效
            type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    legend: {data: [ '计划耗时']},
    xAxis: [{type: 'value'}],
    yAxis: [
        {
            type: 'category',
            axisTick: {show: false},
            data: []
        }
    ],
    series: [
        {
            name: '计划耗时',
            type: 'bar',
            stack: 'total',
            label: {normal: {show: true}
            },
            data: []
        }
    ]
});
$.get('getProcessEstimate').done(function (data) {
    myChart.setOption({
        yAxis: {
            data: data.categories
        },
        series: [{
            name: '计划耗时',
            data: data.data
        }]
    });
});
window.onresize = function () {
    resizeWorldMapContainer();
    myChart.resize();
};